Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Defining an object reference as a parameter

Procedures, user-defined functions, and class-based methods can all define object references as parameters. Object references are always passed by value. However, only a copy of the object reference is made, not the object itself. An object reference parameter cannot be passed to or from a remote application server (neither as a value nor as a field in a temp-table).

This is the syntax to define an object reference as a parameter for a method in a class or a user-defined function in a procedure:

Syntax
[ INPUT | INPUT-OUTPUT | OUTPUT ] parameter-name AS [ CLASS ] type-name 

This is the syntax to define an object reference as a parameter for a procedure:

Syntax
DEFINE [ INPUT | INPUT-OUTPUT | OUTPUT ] PARAMETER parameter-name  
    AS [ CLASS ] type-name ] . 

Element descriptions for these syntax diagrams follow:

parameter-name

The name of the parameter representing the object reference.

CLASS

The CLASS keyword is required if type-name conflicts with an abbreviation for a built in Progress data type, such as INT (INTEGER). Otherwise, it can optionally be used to clarify the readability of the statement.

type-name

The type name of the class or interface, which defines the data type of the parameter. For more information on type names, see the "Using the CLASS construct" section or the "Using the INTERFACE construct" section, respectively.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095